this.BX=this.BX||{};this.BX.Landing=this.BX.Landing||{};this.BX.Landing.UI=this.BX.Landing.UI||{};(function(e,t,n,o,a,l){"use strict";var i=Symbol("showPseudoContent");var s=Symbol("hidePseudoContent");var r=Symbol("disableEditorPointerEvents");var d=Symbol("enableEditorPointerEvents");var u=function(e){babelHelpers.inherits(o,e);function o(){var e;var l=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};babelHelpers.classCallCheck(this,o);e=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(o).call(this,l));babelHelpers.defineProperty(babelHelpers.assertThisInitialized(e),"shouldAdjustTopPanelControls",false);e.setEventNamespace("BX.Landing.UI.Panel.StylePanel");e.setTitle(a.Loc.getMessage("LANDING_DESIGN_PANEL_HEADER"));e.pseudoContent=t.Runtime.clone(e.content);e.loader=new n.Loader({target:e.pseudoContent,offset:{top:"-10%"}});e.lsCache=new t.Cache.LocalStorageCache;e.cache=new t.Cache.MemoryCache;e.switcher=e.getSwitcher();e.closeByEsc=false;t.Dom.addClass(e.layout,"landing-ui-panel-style");t.Dom.addClass(e.overlay,"landing-ui-panel-style-overlay");t.Dom.attr(e.layout,"hidden","true");t.Dom.clean(e.pseudoContent);t.Dom.style(e.pseudoContent,"margin-left","20px");t.Dom.append(e.pseudoContent,e.body);t.Dom.append(e.switcher.layout,e.footer);t.Dom.prepend(e.layout,e.getViewContainer());if(window.localStorage){var i=window.localStorage.getItem("selectGroup")==="true";e.lsCache.set("selectGroup",i.toString())}return e}babelHelpers.createClass(o,[{key:"getSwitcher",value:function e(){var n=this;return this.cache.remember("switcher",(function(){return new BX.Landing.UI.Field.Switch({title:a.Loc.getMessage("LANDING_STYLE_PANEL_SELECT_GROUP_SWITCH"),onValueChange:function e(){if(window.localStorage){window.localStorage.setItem("selectGroup",n.switcher.getValue().toString())}n.lsCache.set("selectGroup",n.switcher.getValue().toString())},value:t.Text.toBoolean(n.lsCache.get("selectGroup"))})}))}},{key:"getViewContainer",value:function e(){return this.cache.remember("viewContainer",(function(){return l.PageObject.getRootWindow().document.querySelector(".landing-ui-view-container")}))}},{key:"getViewWrapper",value:function e(){var t=this;return this.cache.remember("viewWrapper",(function(){return t.getViewContainer().querySelector(".landing-ui-view-wrapper")}))}},{key:i,value:function e(){t.Dom.attr(this.content,"hidden",true);t.Dom.attr(this.pseudoContent,"hidden",null)}},{key:s,value:function e(){t.Dom.attr(this.content,"hidden",null);t.Dom.attr(this.pseudoContent,"hidden",true)}},{key:"show",value:function e(n){var a=this;this[i]();o[r]();if(n){if(!t.Dom.hasClass(this.layout,"landing-ui-style-form-mode")){t.Dom.addClass(this.layout,"landing-ui-style-form-mode");t.Dom.insertAfter(this.overlay,this.layout);t.Dom.removeClass(this.overlay,"landing-ui-panel-style-overlay")}}else{t.Dom.addClass(this.overlay,"landing-ui-panel-style-overlay");t.Dom.removeClass(this.layout,"landing-ui-style-form-mode")}t.Dom.remove(this.overlay);return babelHelpers.get(babelHelpers.getPrototypeOf(o.prototype),"show",this).call(this).then((function(){a.loader.show();setTimeout((function(){a[s]();o[d]()}),300);if(!n){t.Dom.style(a.getViewWrapper(),"max-width","calc(100% - 320px)");t.Dom.addClass(document.body,"landing-ui-collapsed")}BX.onCustomEvent("BX.Landing.Style:enable",[]);a.emit("enable",{panel:a});return a}))}},{key:"hide",value:function e(){var n=this;o[r]();t.Dom.style(this.getViewWrapper(),"max-width",null);return babelHelpers.get(babelHelpers.getPrototypeOf(o.prototype),"hide",this).call(this).then((function(){o[d]();t.Dom.addClass(document.body,"landing-ui-collapsed");BX.onCustomEvent("BX.Landing.Style:disable",[]);n.emit("disable",{panel:n});return n}))}},{key:"prepareFooter",value:function e(){var n=arguments.length>0&&arguments[0]!==undefined?arguments[0]:true;if(n){this.footer.hidden=false;t.Dom.removeClass(this.body,"landing-ui-panel-content-body_long")}else{this.footer.hidden=true;t.Dom.addClass(this.body,"landing-ui-panel-content-body_long")}}}],[{key:"getInstance",value:function e(){var t=l.PageObject.getRootWindow();if(!t.BX.Landing.UI.Panel.StylePanel.instance&&!o.instance){t.BX.Landing.UI.Panel.StylePanel.instance=new o}return t.BX.Landing.UI.Panel.StylePanel.instance||o.instance}},{key:d,value:function e(){t.Dom.style(document.body,"pointer-events",null)}},{key:r,value:function e(){t.Dom.style(document.body,"pointer-events","none")}}]);return o}(o.Content);e.StylePanel=u})(this.BX.Landing.UI.Panel=this.BX.Landing.UI.Panel||{},BX,BX,BX.Landing.UI.Panel,BX.Landing,BX.Landing);
//# sourceMappingURL=stylepanel.bundle.map.js